import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '流程状态',
    align:"center",
    dataIndex: 'bpmStatus'
   },
   {
    title: '单据号',
    align:"center",
    dataIndex: 'vbillcode'
   },
   {
    title: '单据日期',
    align:"center",
    dataIndex: 'dbilldate'
   },
   {
    title: '调入仓库',
    align:"center",
    dataIndex: 'entercstordoc'
   },
   {
    title: '调入仓库id',
    align:"center",
    dataIndex: 'entercstordocid'
   },
   {
    title: '调出仓库',
    align:"center",
    dataIndex: 'outcstordoc'
   },
   {
    title: '调出仓库id',
    align:"center",
    dataIndex: 'outcstordocid'
   },
   {
    title: '业务员',
    align:"center",
    dataIndex: 'cpsnid'
   },
   {
    title: '入库类型',
    align:"center",
    dataIndex: 'ctrantype'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '流程状态',
    field: 'bpmStatus',
    component: 'Input',
  },
  {
    label: '单据号',
    field: 'vbillcode',
    component: 'Input',
  },
  {
    label: '单据日期',
    field: 'dbilldate',
    component: 'Input',
  },
  {
    label: '调入仓库',
    field: 'entercstordoc',
    component: 'Input',
  },
  {
    label: '调入仓库id',
    field: 'entercstordocid',
    component: 'Input',
  },
  {
    label: '调出仓库',
    field: 'outcstordoc',
    component: 'Input',
  },
  {
    label: '调出仓库id',
    field: 'outcstordocid',
    component: 'Input',
  },
  {
    label: '业务员',
    field: 'cpsnid',
    component: 'Input',
  },
  {
    label: '入库类型',
    field: 'ctrantype',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表单数据
//子表表格配置
export const iaIjbillBColumns: JVxeColumn[] = [
    {
      title: '物料',
      key: 'cinventory',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '物料编码',
      key: 'cinventorycode',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '物料id',
      key: 'cinventoryid',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '批次号',
      key: 'vbatchcode',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '数量',
      key: 'nastnum',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '单价',
      key: 'nprice',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '金额',
      key: 'nmny',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '来源单据类型',
      key: 'vsrctype',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '来源单据号',
      key: 'vsrccode',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '来源单据',
      key: 'csrcid',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '来源单据分录',
      key: 'csrcbid',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '主表id',
      key: 'idH',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]


// 高级查询数据
export const superQuerySchema = {
  bpmStatus: {title: '流程状态',order: 0,view: 'text', type: 'string',},
  vbillcode: {title: '单据号',order: 1,view: 'text', type: 'string',},
  dbilldate: {title: '单据日期',order: 2,view: 'text', type: 'string',},
  entercstordoc: {title: '调入仓库',order: 3,view: 'text', type: 'string',},
  entercstordocid: {title: '调入仓库id',order: 4,view: 'text', type: 'string',},
  outcstordoc: {title: '调出仓库',order: 5,view: 'text', type: 'string',},
  outcstordocid: {title: '调出仓库id',order: 6,view: 'text', type: 'string',},
  cpsnid: {title: '业务员',order: 7,view: 'text', type: 'string',},
  ctrantype: {title: '入库类型',order: 8,view: 'text', type: 'string',},
  //子表高级查询
  iaIjbillB: {
    title: '调拨单子表',
    view: 'table',
    fields: {
        cinventory: {title: '物料',order: 0,view: 'text', type: 'string',},
        cinventorycode: {title: '物料编码',order: 1,view: 'text', type: 'string',},
        cinventoryid: {title: '物料id',order: 2,view: 'text', type: 'string',},
        vbatchcode: {title: '批次号',order: 3,view: 'text', type: 'string',},
        nastnum: {title: '数量',order: 4,view: 'text', type: 'string',},
        nprice: {title: '单价',order: 5,view: 'text', type: 'string',},
        nmny: {title: '金额',order: 6,view: 'text', type: 'string',},
        vsrctype: {title: '来源单据类型',order: 7,view: 'text', type: 'string',},
        vsrccode: {title: '来源单据号',order: 8,view: 'text', type: 'string',},
        csrcid: {title: '来源单据',order: 9,view: 'text', type: 'string',},
        csrcbid: {title: '来源单据分录',order: 10,view: 'text', type: 'string',},
        idH: {title: '主表id',order: 11,view: 'text', type: 'string',},
    }
  },
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
